This repository has no description
1<script lang="ts">
2 // the @ resets out of the profile shell, repo pages want their own header and
3 // tabs instead of the profile card
4 import { page } from "$app/state";
5 import RepoHeader from "$lib/components/repo/RepoHeader.svelte";
6 import RepoTabs from "$lib/components/repo/RepoTabs.svelte";
7
8 let { children, data } = $props();
9
10 const fullName = $derived(`${data.repo.ownerHandle}/${data.repo.name}`);
11 const repoUrl = $derived(`${page.url.origin}/${fullName}`);
12 const fullNameWithoutAt = $derived(fullName.replace(/^@/, ""));
13
14 const activeTab = $derived.by(() => {
15 const segment = page.route.id?.split("/")[3] ?? "";
16 return ["issues", "pulls", "pipelines", "settings"].includes(segment) ? segment : "overview";
17 });
18
19 // commit pages break out of the reading column, everything else stays
20 // capped
21 const fullWidth = $derived((page.route.id ?? "").includes("/commit/"));
22</script>
23
24<!-- todo: og and twitter card tags, the appview has repo/fragments/og.html -->
25<svelte:head>
26 <title>{fullName} · Tangled</title>
27 <meta name="description" content={data.repo.description ?? "A repository on Tangled"} />
28 <meta name="vcs:clone" content={repoUrl} />
29 <meta name="forge:summary" content={repoUrl} />
30 <meta name="forge:dir" content={`${repoUrl}/tree/{ref}/{path}`} />
31 <meta name="forge:file" content={`${repoUrl}/blob/{ref}/{path}`} />
32 <meta name="forge:line" content={`${repoUrl}/blob/{ref}/{path}#L{line}`} />
33 <meta
34 name="go-import"
35 content={`tangled.sh/${fullNameWithoutAt} git https://tangled.sh/${fullName}`}
36 />
37 <meta
38 name="go-import"
39 content={`tangled.org/${fullNameWithoutAt} git https://tangled.org/${fullName}`}
40 />
41</svelte:head>
42
43<section class={fullWidth ? "w-full px-2 py-6 sm:px-4" : "mx-auto w-full max-w-screen-lg py-6"}>
44 <RepoHeader repo={data.repo} counts={data.counts} viewerStarRkey={data.viewerStarRkey} />
45 <RepoTabs repo={data.repo} counts={data.counts} active={activeTab} />
46 {@render children()}
47</section>